package com.ruoyi.system.enums;

import lombok.Getter;

/**
 * @author : yangcan
 * @date : 2023/4/7 10:48
 */
@Getter
public enum DeclarationStateEnum {
    DECLARATION_TOBE_ACCEPT(0,"待采纳"),
    DECLARATION_ACCEPT(1,"采纳中"),
    DECLARATION_WARING(2,"发布预警"),
    ;
    private String message ;
    private Integer code ;
    DeclarationStateEnum(Integer code , String message){
        this.code = code ;
        this.message = message ;
    }

    public static String getMessageByCode(Integer code){
        DeclarationStateEnum[] values = DeclarationStateEnum.values();
        for (DeclarationStateEnum value : values) {
            if (value.getCode().equals(code)){
                return value.getMessage() ;
            }
        }
        return "未知" ;
    }
}
